package aiingames.simulation.server.physics;


import com.vividsolutions.jts.geom.Coordinate;

public class AgentParticle implements Particle {
	
	public static final double PARTICLE_WEIGHT = 80;
	public static final double PARTICLE_DIAMETER = 0.7;
	
	private Coordinate currentPosition;
	private final Force force = new Force(PARTICLE_WEIGHT);
	private final double maxVelocity;
	
	private double vx;
	private double vy;
	
	public AgentParticle(Coordinate location) {
		this.maxVelocity = 3;
		this.currentPosition = location;
	}
	
	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#getPosition()
	 */
	@Override
	public Coordinate getPosition() {
		return this.currentPosition;
	}
	
	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#getVx()
	 */
	@Override
	public double getVx() {
		return this.vx;
	}

	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#getVy()
	 */
	@Override
	public double getVy() {
		return this.vy;
	}
	
	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#getForce()
	 */
	@Override
	public Force getForce() {
		return this.force;
	}
	
	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#getMaxVelocity()
	 */
	@Override
	public double getMaxVelocity() {
		return this.maxVelocity;
	}

	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#setCurrentVelocity(double, double)
	 */
	@Override
	public void setCurrentVelocity(double vx, double vy) {
		this.vx = vx;
		this.vy = vy;
	}

	/* (non-Javadoc)
	 * @see playground.gregor.aiingames.server.physics.Particle#moveToPosition(com.vividsolutions.jts.geom.Coordinate)
	 */
	@Override
	public void moveToPosition(Coordinate newPos) {
		this.currentPosition.setCoordinate(newPos);
		
	}

	@Override
	public double getWeight() {
		return PARTICLE_WEIGHT;
	}

	@Override
	public double getDiameter() {
		return PARTICLE_DIAMETER;
	}
}
